package com.huaqin.hellojni;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.widget.TextView;

public class MainActivity extends Activity {

	private TextView mytv;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        mytv = (TextView)findViewById(R.id.mytv);
//        mytv.setText(stringFromJNI());
        mytv.setText(String.valueOf(Add(1,2)));
        
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
    
    public native String stringFromJNI();
    public native long Add( long x, long y);
    
    static{
        System.loadLibrary("nativecode");
    }
    
}
